<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
<head>
	<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
	<meta name="language" content="en" />

	<!-- blueprint CSS framework -->
	<link rel="stylesheet" type="text/css" href="<?php echo Yii::app()->request->baseUrl; ?>/css/screen.css" media="screen, projection" />
	<link rel="stylesheet" type="text/css" href="<?php echo Yii::app()->request->baseUrl; ?>/css/print.css" media="print" />
	<!--[if lt IE 8]>
	<link rel="stylesheet" type="text/css" href="<?php echo Yii::app()->request->baseUrl; ?>/css/ie.css" media="screen, projection" />
	<![endif]-->

	<link rel="stylesheet" type="text/css" href="<?php echo Yii::app()->request->baseUrl; ?>/css/main.css" />
	<link rel="stylesheet" type="text/css" href="<?php echo Yii::app()->request->baseUrl; ?>/css/form.css" />

	<title><?php echo CHtml::encode($this->pageTitle); ?></title>
</head>

<body>

<?php
	$jqueryslidemenupath = Yii::app()->assetManager->publish(Yii::app()->basePath.'/scripts/jqueryslidemenu/');

	//Register jQuery, JS and CSS files
	Yii::app()->clientScript->registerCoreScript('jquery');
	Yii::app()->clientScript->registerCssFile($jqueryslidemenupath.'/jqueryslidemenu.css');
	Yii::app()->clientScript->registerScriptFile($jqueryslidemenupath.'/jqueryslidemenu.js');
?>

<div class="container" id="page">

	<div id="header">
        <div id="logo" style="float: left;">
            <?php echo CHtml::image('images/pekin_logo_web.png','Projecte Pekin')?>
            <!--<?php echo CHtml::encode(Yii::app()->name); ?>-->
        </div><!--logo-->

        <div id="usuconnectat" style="width: 50%; margin-right: 10px; float: right; text-align: right;">
            <br/>
            <?php
            if (!Yii::app()->user->isGuest) {
                echo '<b>'.Yii::app()->user->name.'</b> ('.Yii::app()->user->getState('rol').'@'.Yii::app()->user->getState('dispositiu').')<br/> ';
                echo CHtml::link('Desconnectar', array('site/logout')).' | ';
                echo CHtml::link('Perfil', array('perfil/index','id'=>Yii::app()->user->id));
            }
            ?>
        </div><!-- usuconnectat -->
        <div id="separador" style="clear:both;"></div><!--per corregir on es mostra usu-->
	</div><!-- header -->

	<!--<div id="mainmenu">-->
	<div id="myslidemenu" class="jqueryslidemenu">

		<?php $this->widget('zii.widgets.CMenu',array(
			'items'=>array(
				array('label'=>'Inici', 'url'=>array('/site/index')),
                array('label'=>'Comandes', 'url'=>array('/comanda/admin'),
                        'visible'=>(Yii::app()->user->checkAccess('servei')
                        or Yii::app()->user->checkAccess('cuina')
                        or Yii::app()->user->checkAccess('caixa')),
                ),
                array('label'=>'Productes', 'url'=>array('/producte/admin'),
                    'visible'=>Yii::app()->user->checkAccess('admin'),),
                array('label'=>'Admin', 'url'=>array(''), 'items'=>array(
                    array('label'=>'Taules', 'url'=>array('/taula/admin')),
                    //array('label'=>'Estats comanda', 'url'=>array('/estat/admin')),
                    array('label'=>'Categories productes', 'url'=>array('/categoria/admin')),
                    array('label'=>'Usuaris', 'url'=>array('/persona/admin')),
                ),'visible'=>Yii::app()->user->checkAccess('admin'),),
				array('label'=>'Versió', 'url'=>array('/site/page', 'view'=>'about')),
				//array('label'=>'Contacte', 'url'=>array('/site/contact')),
				//array('label'=>'Connectar', 'url'=>array('/site/login'), 'visible'=>Yii::app()->user->isGuest),
				//array('label'=>'Desconnectar ('.Yii::app()->user->name.'/'.Yii::app()->user->getstate('rol').')', 'url'=>array('/site/logout'), 'visible'=>!Yii::app()->user->isGuest)
			),
		)); ?>

                <br style="clear: left" />
	</div><!-- mainmenu -->

	<?php $this->widget('zii.widgets.CBreadcrumbs', array(
		'links'=>$this->breadcrumbs,
	)); ?><!-- breadcrumbs -->

	<?php echo $content; ?>

	<div id="footer">
		&copy; <?php echo date('Y'); ?> per Anagrama Informàtics SL<br/>
                Grup 01 - Síntesi ASI<br/>
		Tots els drets reservats.<br/>
		<?php echo Yii::powered(); ?>
	</div><!-- footer -->

</div><!-- page -->

</body>
</html>